<?php

/**
 * LEAGUEMan
 * 
 * Copyright (C) 2007 Marko Bischof
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

?>

<script langugae="javascript">
	function createMatch(a,b){
		var f = document.adminForm;
		if(f){
			f.elements['match_team1'].value = a;
			f.elements['match_team2'].value = b;
			f.elements['task'].value = 'creatematch';
			f.submit();
		}
	}
	
	function deleteMatch(c){
		var f = document.adminForm;
		if(f){
			f.elements['match2delete'].value = c;
			f.elements['task'].value = 'deletematch';
			f.submit();
		}
	}
	
	function clearDate(){
		var f = document.adminForm;
		if(f){
			f.elements['match_date'].value = '0000-00-00';
			f.elements['match_time'].value = '00:00';
		}
	}
</script>

<form action="index2.php" method="post" name="adminForm" id="adminForm">
	<table cellpadding="4" cellspacing="0" border="0" width="100%">
		<tr>
			<td width="50%%" class="sectionname"><?php echo $this->project->getName();?></td>
			<td align="right" nowrap="nowrap">
				<fieldset><legend>Date / Time</legend>
					<input type="text" name="match_date" size="8" value="<?php echo $this->match_date; ?>" class="text_area" style="text-align: center" />
					<input type="text" name="match_time" size="3" value="<?php echo $this->match_time; ?>" class="text_area" style="text-align: center" />
					<input type="button" name="cleardate" class="button" value="clear" onClick="javascript:clearDate();" />
			</fieldset>
			</td>
			<td align="right" nowrap="nowrap">
				<fieldset><legend>Select</legend>
					<?php echo mosHTML::selectList($this->rounds, 'rid', 'class="text_area" onChange="javascript:document.adminForm.submit();" size="1" style="width:150px;"','value', 'text', $this->rid );?>
				</fieldset>
			</td>
			<td align="right" nowrap="nowrap">
				<fieldset><legend>Invert Round to</legend>
					<?php echo mosHTML::selectList($this->rounds, 'rid2', 'class="text_area" size="1" style="width:150px;"','value', 'text', $this->rid );?>
					<input type="button" name="" class="button" value="go" onClick="javascript:submitbutton('invert');" />
				</fieldset>
			</td>
		</tr>
	</table>
	
	<?php echo $this->matrix; ?>
	
	<input type="hidden" name="option" value="com_leagueman" />
	<input type="hidden" name="act" value="matrix" />
	<input type="hidden" name="task" value="" />
	
	<input type="hidden" name="match_team1" value="" />
	<input type="hidden" name="match_team2" value="" />
	<input type="hidden" name="match2delete" value="" />
</form>